package com.wangzhixuan.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.wangzhixuan.model.Rank;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;


/**
 * <p>
  *  Mapper 接口
 * </p>
 *
 * @author zhixuan.wang
 * @since 2017-08-15
 */
public interface RankMapper extends BaseMapper<Rank> {

	List<Rank> selectRankPage(Pagination page, Map<String, Object> params);
	
	List<Map<String, Object>> selectlist();
	
	Rank selectRanking(@Param("userId") Integer userId,@Param("workId") Integer workId);
	
	void updateUserOnTime(@Param("userId") Integer userId);
	
	void updateUserDeTime(@Param("userId") Integer userId);
	
	void updateUserFail(@Param("userId") Integer userId);
	
	List selectTotalOnTimeNum();
	
	//Rank selectRankForRank(@Param("totalOnTimeNum") Integer totalOnTimeNum);
	
	void updateRanking(@Param("ranking") Integer ranking,@Param("totalOnTimeNum")Integer totalOnTimeNum);
	
	int selectUserTotalOnTimeNum(@Param("userId")Integer userId);			//通过userId获取用户TotalOnTimeNum
	
	Integer selectUserRank(@Param("userId")Integer userId);			//通过userId获取用户rank
}